import Home from '@/views/home/Home.vue'
import Center from '@/views/center/Center.vue'
import UserAdd from '@/views/user-manage/UserAdd'
import UserList from '@/views/user-manage/UserList'
import StudentList from '@/views/user-manage/StudentList'
import CourseAdd from '@/views/course-manage/CourseAdd'
import CourseList from '@/views/course-manage/CourseList'
import CourseEdit from '@/views/course-manage/CourseEdit'
import ScoreAdd from '@/views/score-manage/ScoreAdd'
import ScoreList from '@/views/score-manage/ScoreList'
import ScoreEdit from '@/views/score-manage/ScoreEdit'
import ScoreReEdit from '@/views/score-manage/ScoreReEdit'
import ScoreAnalysis from '@/views/score-manage/ScoreAnalysis'
import MyCourse from '@/views/mycourse/MyCourse'
import MyScore from '@/views/myscore/MyScore'
import NotFound from '@/views/notfound/NotFound'

const routes = [
  { path: '/index', component: Home },
  { path: '/center', component: Center },

  { path: '/user-manage/adduser', component: UserAdd, requireAdmin: true },
  { path: '/user-manage/userlist', component: UserList, requireAdmin: true },
  { path: '/user-manage/studentlist', component: StudentList, requireAdmin: true },
  { path: '/course-manage/addcourse', component: CourseAdd, requireAdmin: true },
  { path: '/course-manage/courselist', component: CourseList, requireTeacher: true },
  { path: '/course-manage/editcourse/:id', component: CourseEdit, requireTeacher: true },
  { path: '/score-manage/addscore', component: ScoreAdd, requireTeacher: true },
  { path: '/score-manage/scorelist', component: ScoreList, requireTeacher: true },
  { path: '/score-manage/editscore/:id', component: ScoreEdit, requireTeacher: true },
  { path: '/score-manage/reeditscore/:id', component: ScoreReEdit, requireTeacher: true },
  { path: '/score-manage/scoreanalysis/:id', component: ScoreAnalysis, requireTeacher: true },

  { path: '/mycourse', component: MyCourse, requireStudent: true },
  { path: '/myscore', component: MyScore, requireStudent: true },

  { path: '/', redirect: '/index' },
  { path: '/:pathMatch(.*)', name: 'NotFound', component: NotFound }
]

export default routes
